package com.blast.cn.ui

import android.view.KeyEvent
import com.blast.cn.R
import com.tencent.bugly.beta.Beta
import com.wxl.common.AppContext
import com.wxl.common.base.AbsActivity
import com.wxl.common.util.SystemUtil
import kotlinx.android.synthetic.main.activity_soft_version_layout.*

class SoftWareVersionActivity : AbsActivity() {

    override fun getCreateContentViewId(): Int {
        return R.layout.activity_soft_version_layout
    }

    override fun onCreateViewChanged() {
        setTopTitle("软件版本")
        softVersionText.text = SystemUtil.getVersionName(this)
        softVersionLayout.setOnClickListener {
            Beta.checkUpgrade(true, true)
        }
        controllerVersionText.text = AppContext.appContext.getDeviceVersion().toString()
    }

    override fun onKeyDownEvent(keyCode: Int, event: KeyEvent?): Boolean {
        if(keyCode == KeyEvent.KEYCODE_BACK){
            finish()
        }
        return true
    }


}